package com.jiangxjsy.admin.controller;

import com.jiangxjsy.admin.service.AdminMessageService;
import com.jiangxjsy.core.wrap.Result;
import com.jiangxjsy.core.wrap.ResultBuilder;
import com.jiangxjsy.model.admin.vo.AdminMessageVO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * wukong-crm-master
 * 蒋胜宇
 * 2025/6/6 16:55
 */

@RestController
@RequestMapping("/adminMessage")
public class AdminMessageController {
    @Resource
    private AdminMessageService adminMessageService;

    /**
     * 查询未读消息数量
     *
     * @return 未读消息数量
     */
    @PostMapping("/queryUnreadCount")
    public Result<AdminMessageVO> queryUnreadCount(HttpServletRequest request, HttpServletResponse response) {
        return ResultBuilder.ok(adminMessageService.queryUnreadCount(request, response));
    }
}
